package com.zxj.nb.service.impl;


import com.zxj.nb.entity.AuthEntity;
import com.zxj.nb.entity.UserEntity;
import com.zxj.nb.mapper.UserMapper;
import com.zxj.nb.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Set;

@Service
public class UserServiceImpl  implements IUserService {

    @Autowired
    UserMapper userMapper;

    /**
     * 登录验证
     * @param uaccount
     * @return
     */
    public UserEntity findByUaccount(String uaccount){
        return  userMapper.findByUaccount(uaccount);
    }

    /**
     * shrio配置权限map的
     * @return
     */
    public List<AuthEntity> getAuth(){
        return  userMapper.getAuth();
    }

    /**
     * 查询所有角色
     * @param uaccount
     * @return
     */
    public Set<String> getRolesByUaccount(String uaccount){
        return userMapper.getRolesByUaccount(uaccount);
    }

}
